import React, { useState, useEffect, useCallback } from 'react'
import './App.css'
import {
    HashRouter as Router,
    Switch,
    Route,
} from "react-router-dom"
import routes from '../src/router'
import Navbar from '@/component/Navbar/navbar'
import fetch from './api/request'

const whiteUrl = ['/', '/modules'];

fetch.get('getJSONFile', {
    name: 'modules'
}).then(data => {
    data
})

function App(props: any) {

    return (
        <Router>
            <Navbar />
            <Switch>
                {
                    routes.map(route => <Route exact key={route.path} path={route.path}>
                        <route.component />
                    </Route>)
                }
            </Switch>

        </Router>
    )
}

export default App
